package com.parking.mapper;

import com.parking.pojo.Message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.DateTimeException;
import java.util.Date;

public interface MessageMapper {
    //增加
    @Insert("insert into message(messagenumber,messagename,messagein,messageout) values (#{messagenumber},#{messageuser});")
    int add(Message message);

    //根据id删除
    @Delete("delete from message where messageid = #{messageid}")
    int delete(int messageid);


    //根据id修改
    @Update("update message set messagein = #{messagein},messageout = #{messageout} where messageid = #{messageid}")
    int updateById(DateTimeException messagein, DateTimeException messageout, Integer messageid);

    //查询
    @Select("select * from message where messageid = #{messageid}")
    Message selectById(Integer messageid);
}
